<?php

namespace app\qsapi\controller;

use app\qsapi\service\BoxYunOrderService;
use app\qsapi\service\YunPhoneOrderService;
use think\exception\DbException;
use think\response\Json;


/**
 * 云手机模块
 */
class YunPhoneOrder extends BaseController
{
    /**
     * Notes: 云手机下单
     * User: liubaoqiang
     * DateTime: 2024/12/11 09:39
     * @return Json
     */
    public function yunMakeOrder(): Json
    {
        $member_id       = $this->request->getMemberId();
        $yunOrderService = new YunPhoneOrderService();
        return json($yunOrderService->yunMakeOrder($member_id, $this->request->post()));
    }

    /**
     * Notes: 兑换列表
     * User: liubaoqiang
     * DateTime: 2024/12/17 11:17
     * @return Json
     */
    public function getYunPhoneExchangeList(): Json
    {
        $member_id       = $this->request->getMemberId();
        $yunOrderService = new YunPhoneOrderService();
        return json($yunOrderService->getYunPhoneExchangeList($member_id));
    }
}
